package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"log"
	pb "testpb"
)

func main() {
	dial, err := grpc.Dial(":8080", grpc.WithInsecure())
	if err != nil {
		panic(err)
	}
	defer dial.Close()

	client := pb.NewHelloServiceClient(dial)

	background := context.WithValue(context.Background(), "hello", "world")

	hello, err := client.GetHello(background, &pb.HelloRequest{
		Id:       2220,
		HelloMsg: "hello pbmodel",
	})
	if err != nil {
		log.Println(err)
		return
	}
	fmt.Println(hello.RetMsg)

}
